import { removeSpin } from '@/utils';
import user from './module/user';
let spinTimer = null;
const state = {
    ...user.state
};
const effects = {
    ...user.effects
};
const reducers = {
    ...user.reducers
};

const global = {
    state,
    effects,
    reducers,
    namespace: 'global',
    subscriptions: {
        setup({ dispatch, history }) {
            return history.listen(({ pathname, query }) => {
                clearTimeout(spinTimer);
                spinTimer = window.setTimeout(() => {
                    removeSpin(pathname, query, dispatch);
                }, 600);
            });
        }
    }
};
export default global;
